/**
 * @file lr_base_diver.h
 * @author your name (you@domain.com)
 * @brief 
 * @version 0.1
 * @date 2024-01-30
 * 
 * @copyright Copyright (c) 2024
 * 
 */
#ifndef __LR_BASE_DIVER_H__
#define __LR_BASE_DIVER_H__

#ifdef __cplusplus
extern "C" {
#endif
/*lr平台空指针*/
#define LR_NULL (0)
#define LR_OK   (0)
#define LR_ERR  (0)

/**
 * @brief lr平台的设备驱动通用结构体
 * 
 */
typedef struct 
{
    int ( *init )   ( void );
    int ( *open )   ( unsigned int flag);
    int ( *ctrl )   ( int cmd, void *args);
    int ( *read )   ( int pos, void *buffer,unsigned int size);
    int ( *write )  ( int pos, const void *buffer,unsigned int size);
    int ( *close )  ( void );
}lr_diver_ops_t;

extern int lr_diver_close(void* puart);

#ifdef __cplusplus
}
#endif

#endif/*__LR_BASE_DIVER_H__*/
